/* 头部样式 */
.header {
    background-color: #333;
    padding: 15px 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.header .wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo h1 a {
    color: white;
    text-decoration: none;
    font-size: 24px;
}

.nav ul {
    display: flex;
    list-style: none;
}

.nav ul li {
    margin-left: 20px;
}

.nav ul li a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav ul li a:hover,
.nav ul li a.active {
    background-color: #555;
}

.search input {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    width: 250px;
    margin-right: 10px;
}

.search button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 主体内容区 - 横向滚动 */
.main-content {
    margin-top: 100px;
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    overflow-x: auto; /* 允许横向滚动 */
    white-space: nowrap; /* 防止换行 */
}

/* 电影卡片容器 - 横向排列 */
.movies-container {
    display: inline-block; /* 让容器可以横向滚动 */
    white-space: normal; /* 恢复正常的换行行为 */
    padding: 10px 0; /* 添加上下内边距 */
}

/* 电影卡片样式 - 横向排列 */
.movie-card {
    display: inline-block; /* 横向排列 */
    vertical-align: top; /* 顶部对齐 */
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 10px; /* 增加上下左右间距 */
    width: 250px; /* 固定宽度 */
    transition: transform 0.3s;
    white-space: normal; /* 允许内容换行 */
}

.movie-card:hover {
    transform: translateY(-5px);
}

.movie-poster {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.movie-info {
    padding: 15px;
}

.movie-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 标题过长时显示省略号 */
}

.movie-rating {
    color: #f39c12;
    margin-bottom: 8px;
    font-weight: bold;
}

.movie-comment {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    display: -webkit-box;
    overflow: hidden;
}

.movie-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    flex: 1;
}

.btn-want {
    background-color: #28a745;
    color: white;
}

.btn-want:hover {
    background-color: #218838;
}

.btn-watched {
    background-color: #007bff;
    color: white;
}

.btn-watched:hover {
    background-color: #0056b3;
}

.btn-success {
    background-color: #28a745 !important;
}

/* 响应式设计 - 在小屏幕上调整卡片宽度 */
@media (max-width: 768px) {
    .header .wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav ul {
        justify-content: center;
    }
    
    .search input {
        width: 200px;
    }
    
    .movie-card {
        width: 200px; /* 小屏幕时卡片更窄 */
        margin: 8px; /* 小屏幕时减少间距 */
    }
    
    .movie-poster {
        height: 240px;
    }
}

@media (max-width: 480px) {
    .movie-card {
        width: 180px; /* 更小屏幕时卡片更窄 */
        margin: 6px; /* 更小屏幕时进一步减少间距 */
    }
    
    .movie-poster {
        height: 220px;
    }
}